<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
<base href="${path}/">
<meta charset="UTF-8">
<title>非AJAX方式提交表单</title>
</head>
<body>
<center>
	<h1>用户登陆</h1><hr>
	<form method="post" action="action/my/login1" onsubmit="return checkform()">
		<table>
			<tr>
				<td>账号：</td>
				<td><input type="text" name="uname" id="uname"></td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="text" name="passwd" id="passwd"></td>
			</tr>
			<tr align="center">
				<td colspan="2">
					<input type="submit" value="提交">
					<input type="reset" value="重置">
				</td>
			</tr>
		</table>
	</form>
</center>

<script src="js/jquery-1.7.min.js"></script>
<script>
function checkform() {
	var uname = $('#uname').val();
	var passwd = $('#passwd').val();
	if(uname=='' || passwd=='') {
		alert('账号和密码不能为空');
		return false;
	}
	
	return true;
}
</script>
</body>
</html>